//
//  UATRequestConfig.h
//  Pods-UStarter_Example
//
//  Created by Mark on 2021/1/7.
//

#import <Foundation/Foundation.h>
#import "UATApi.h"
#import "UATRequestOption.h"
NS_ASSUME_NONNULL_BEGIN

/// 全局参数设置在请求的什么地方
typedef NS_ENUM(NSInteger,UATRequestConfigScope) {
    UATRequestConfigScopeURL=0,
    UATRequestConfigScopeHEADER=1,
    UATRequestConfigScopeBODY=2
};

@interface UATRequestConfig : NSObject

@property (nonatomic,strong) NSDictionary * globalParam ;
@property (nonatomic,strong) NSString * baseUrl;
@property (nonatomic,assign) UATRequestConfigScope scope ;


/// 初始化请求配置项
- (instancetype) initWithGlobalParam:(NSDictionary*)param scope:(UATRequestConfigScope)scope baseUrl:(NSString*)baseUrl;


/// 转换请求对象为AFNetworking使用的对象
- (UATRequestOption*)toOptWithAction:(NSString*)action param:(nullable NSDictionary*)param data:(nullable NSDictionary*)data;

@end

NS_ASSUME_NONNULL_END
